package com.sw.server;

import com.sw.servlet.HttpServlet;
import com.sw.servlet.Request;
import com.sw.servlet.Response;

/**
 * @author sw
 * @project minicat
 * @description
 * @date 2020/4/29 22:49
 */
public class SwServerlet extends HttpServlet {
    @Override
    public void doGet(Request request, Response response) {

        String str="<h1>hello world Get</h1>";
        response.output(HttpProtocolUtil.getHttpHeader200(str.getBytes().length)+str);
    }

    @Override
    public void doPost(Request request, Response response) {
        String str="<h1>hello world POST</h1>";
        response.output(HttpProtocolUtil.getHttpHeader200(str.getBytes().length)+str);

    }

    @Override
    public void init(String servletName) {

    }

    @Override
    public void destory() {

    }
}
